<?php
/**
 * @package		Joomla.Administrator
 * @subpackage	com_forum
 * @copyright	Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
 * @license		GNU General Public License version 2 or later; see LICENSE.txt
 */

// no direct access
defined('_JEXEC') or die;

JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
JHtml::_('behavior.tooltip');
JHtml::_('behavior.formvalidation');

?>

<script type="text/javascript">
	Joomla.submitbutton = function(task)
	{
		if (task == 'post.cancel' || document.formvalidator.isValid(document.id('post-form'))) {
			Joomla.submitform(task, document.getElementById('post-form'));
		}
		else {
			alert('<?php echo $this->escape(JText::_('JGLOBAL_VALIDATION_FORM_FAILED'));?>');
		}
	}
</script>
<div class="forum-post-add<?php echo $this->pageclass_sfx;?>">


<h1>
	<?php echo JHtml::_('content.prepare', $this->topic->title, '', 'com_forum.post'); ?>
</h1>

<form action="<?php echo JRoute::_('index.php?option=com_forum&view=category&id=' . $this->catid ); ?>" method="post" name="adminForm" id="post-form" class="form-validate">
	<div class="width-60 fltlft">
		<fieldset class="adminform">
			<?php echo $this->form->getInput('tid'); ?>
			<div class="formelm">
				<?php echo $this->form->getLabel('created_by_alias'); ?>
				<?php echo $this->form->getInput('created_by_alias'); ?>
			</div>
			<div class="formelm">
				<?php echo $this->form->getLabel('message'); ?>
				<?php echo $this->form->getInput('message'); ?>
			</div>
			<div class="formelm">
				<?php echo $this->form->getLabel('captcha'); ?>
				<?php echo $this->form->getInput('captcha'); ?>
			</div>
			
		<?php if ($recaptcha = ForumHelper::getRecaptcha()) : ?>
			<div class="formelm">
			<label id="jform_captcha-lbl" for="jform_capthca" class="hasTip required" title="Captcha::<?php echo JText::_("COM_FORUM_POST_FIELD_CAPTCHA_DESC") ?>"><?php echo JText::_("COM_FORUM_POST_FIELD_CAPTCHA_LABEL") ?><span class="star">&#160;*</span></label>
					<script type="text/javascript"
						src="http://www.google.com/recaptcha/api/challenge?k=<?php echo $recaptcha->publicKey; ?>">
					</script>
					<noscript>
						<iframe src="http://www.google.com/recaptcha/api/noscript?k=<?php echo $recaptcha->publicKey; ?>"
							height="300" width="500" frameborder="0"></iframe><br>
						<textarea name="recaptcha_challenge_field" rows="3" cols="40">
						</textarea>
						<input type="hidden" name="recaptcha_response_field"
							value="manual_challenge">
					</noscript>
			</div>
		<?php endif; ?>			
			
		</fieldset>
	</div>
			<div class="formelm-buttons">
			<button type="button" onclick="Joomla.submitbutton('post.save')">
				<?php echo JText::_('JSAVE') ?>
			</button>
			<button type="button" onclick="Joomla.submitbutton('post.cancel')">
				<?php echo JText::_('JCANCEL') ?>
			</button>
			</div>

		<input type="hidden" name="task" value="" />
	<input type="hidden" name="jform[catid]" value="<?php echo $this->catid ?>" />
		<?php echo JHtml::_('form.token'); ?>
	<div class="clr"></div>
</form>
</div>